package cate.common.table.pvp.minecraft.mine_area_base;

import cate.common.table.ESheet;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@NoteClass("矿洞争霸-开采掠夺 Sheet")
public class MinecraftMineAreaBaseSheet extends ESheet<MinecraftMineAreaBaseRow> {
    @Override
    public String getSheetName() {
        return "灵能矿场跨服";
    }

    @NoteField("层数->点位配置列表")
    public Map<Integer, List<MinecraftMineAreaBaseRow>> rowsByLayer = new HashMap<>();

    @Override
    public void decode() {
        super.decode();
        rowsByLayer.clear();
        for (MinecraftMineAreaBaseRow row : getList()) {
            if (!rowsByLayer.containsKey(row.layer)) {
                rowsByLayer.put(row.layer, new ArrayList<>());
            }
            rowsByLayer.get(row.layer).add(row);
        }
    }
}
